using System.IO;
namespace Cupertino.Support.Helps;
public class FileCreator
{
    // public string BasePath { get; } = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
    public string BasePath => Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
    public void Create()
    {
        string textData = "salmon test file Data";
        string[] tempFiles =
        {
            @"\salmon\works\sudo\test.txt",
            @"\salmon\works\sudo\debug.mp3",
            @"\salmon\vs\apple\class.cs",
            @"\salmon\vs\apple\hello.cs",
            @"\salmon\vs\apple\test.cs",
            @"\salmon\vs\orange\query.txt",
            @"\salmon\works\test\safari.mp3",
            @"\salmon\output\help\test.txt",
            @"\salmon\output\help\test.cs",
        };
        foreach (string file in tempFiles)
        {
            string fullPath = BasePath + file;
            //创建目录
            string dirName = Path.GetDirectoryName(fullPath);
            if (!Directory.Exists(dirName))
            {
                Directory.CreateDirectory(dirName);
            }
            //创建文件
            File.WriteAllText(fullPath, textData);
        }
    }
}